Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf/perf_genericevents.py: Use AMD Zen for parsing #2792

Conversation

AYUSHJAIN951
Copy link
Member

CPU event mappings for AMD Zen processors can vary within the same family. Hence, switch to using the core generation for mapping events. The core generation can be determined by inspecting family and model combinations.

Also update raw_code.cfg with latest event mappings and add an AMD Zen specific formula for computing the raw event code. The formula assumes that the "event" field occupies bits 35:32,7:0 and the "umask" field occupies bits 15:8 as described in the AMD PPRs.

Suggested-by: Sandipan Das [email protected]
Signed-off-by: Ayush Jain [email protected]

CPU event mappings for AMD Zen processors can vary within the same family.
Hence, switch to using the core generation for mapping events.
The core generation can be determined by inspecting family and
model combinations.

Also update raw_code.cfg with latest event mappings and add an AMD Zen
specific formula for computing the raw event code. The formula assumes
that the "event" field occupies bits 35:32,7:0 and the "umask" field
occupies bits 15:8 as described in the AMD PPRs.

Suggested-by: Sandipan Das <[email protected]>
Signed-off-by: Ayush Jain <[email protected]>
@narasimhan-v narasimhan-v changed the title perf/perf_genericevents.py: Use AMD Zen for parsing perf/perf_genericevents.py: Use AMD Zen for parsing [depends on https://github.com/avocado-framework/avocado/pull/5894] Apr 1, 2024
@AYUSHJAIN951 AYUSHJAIN951 changed the title perf/perf_genericevents.py: Use AMD Zen for parsing [depends on https://github.com/avocado-framework/avocado/pull/5894] perf/perf_genericevents.py: Use AMD Zen for parsing Apr 3, 2024
@AYUSHJAIN951
Copy link
Member Author

If amd zen raw_code config available
avocado run perf_genericevents.py
JOB ID     : 189b022bb55c115b31538db8560cb31ca51910d9
JOB LOG    : /home/tests/results/job-2024-04-03T11.36-189b022/job.log
 (1/1) perf_genericevents.py:test_generic_events.test: STARTED
 (1/1) perf_genericevents.py:test_generic_events.test: PASS (0.02 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/tests/results/job-2024-04-03T11.36-189b022/results.html
JOB TIME   : 1.53 s

if not found
avocado run perf_genericevents.py
JOB ID     : e68f4007864d9f1d99e6931039e61d0f0898fc08
JOB LOG    : /home/tests/results/job-2024-04-03T11.36-e68f400/job.log
 (1/1) perf_genericevents.py:test_generic_events.test: STARTED
 (1/1) perf_genericevents.py:test_generic_events.test: CANCEL: AMD ZEN3 raw_code cfg not found (0.02 s)
RESULTS    : PASS 0 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 1
JOB HTML   : /home/tests/results/job-2024-04-03T11.36-e68f400/results.html
JOB TIME   : 1.38 s


[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0062 INFO | AMD Family: 25 ZEN3
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is cache-misses
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0x0964 or 2404 and got 2404
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is cpu-cycles
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0x76 or 118 and got 118
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is stalled-cycles-frontend
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0xa9 or 169 and got 169
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is branch-misses
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0xc3 or 195 and got 195
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is instructions
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0xc0 or 192 and got 192
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is cache-references
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0xff60 or 65376 and got 65376
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0096 INFO | FILE in /sys/bus/event_source/devices/cpu/events is branch-instructions
[stdlog] 2024-04-03 11:36:57,025 avocado.test perf_genericeven L0102 INFO | PASS : Expected value: 0xc2 or 194 and got 194
[stdlog] 2024-04-03 11:36:57,025 avocado.test test             L0751 INFO | PASS 1-perf_genericevents.py:test_generic_events.test
[stdlog] 2024-04-03 11:36:57,025 avocado.test test             L0733 INFO |
[stdlog] 2024-04-03 11:36:57 | Dependency was not fulfilled.

@narasimhan-v narasimhan-v merged commit e566405 into avocado-framework-tests:master Apr 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants